package cn.tedu.tmall.front.content.controller;

import cn.tedu.tmall.common.web.JsonResult;
import cn.tedu.tmall.front.content.pojo.vo.CategoryItemVO;
import cn.tedu.tmall.front.content.service.ICategoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/category")
@RestController
@Slf4j
@Validated
@Tag(name = "分类接口")
@Tag(name="")
public class CategoryController {
    @Autowired
    private ICategoryService categoryService;
    @GetMapping("list")
    @Operation(summary = "类别列表")
    public JsonResult list() {
        List<CategoryItemVO> categoryItemVOList = categoryService.list();
        return JsonResult.ok(categoryItemVOList);
    }
}
